﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Michael Herndon.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	using System.Runtime.Serialization;

	/// <summary>
	/// The base DTO (data transfer object) for twitter, since all possible responses can
	/// come back as an error object. 
	/// </summary>
	[DataContract(Name = "hash", Namespace = "")]
	public class TwitterError
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="TwitterError"/> class.
		/// </summary>
		public TwitterError()
		{
			this.Error = "";
			this.Request = "";
		}

		/// <summary>
		/// Gets or sets the error.
		/// </summary>
		/// <value>The error.</value>
		[DataMember(Name = "error")]
		public string Error { get; set; }

		/// <summary>
		/// Gets a value indicating whether this instance has error.
		/// </summary>
		/// <value><c>true</c> if this instance has error; otherwise, <c>false</c>.</value>
		public bool HasError
		{
			get { return (!string.IsNullOrEmpty(this.Error)); }
		}


		/// <summary>
		/// Gets or sets the request.
		/// </summary>
		/// <value>The request.</value>
		[DataMember(Name = "request")]
		public string Request { get; set; }
	}
}
